home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Milan_1991 / Devcon91.4 / AppShell / Examples / MultiProj / multiproj.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-01  |  7.8 KB  |  191 lines

  1. /*************************************************************************
  2.   *                                                                      *
  3.   *                            Preliminary                               *
  4.   *                        Amiga AppShell (tm)                           *
  5.   *                                                                      *
  6.   *  Copyright (c) 1990,1991 Commodore-Amiga, Inc. All Rights Reserved.  *
  7.   *                                                                      *
  8.   *   This software and information is proprietary, preliminary, and     *
  9.   *   subject to change without notice.                                  *
  10.   *                                                                      *
  11.   *                            DISCLAIMER                                *
  12.   *                                                                      *
  13.   *   THIS SOFTWARE IS PROVIDED "AS IS".                                 *
  14.   *   NO REPRESENTATIONS OR WARRANTIES ARE MADE WITH RESPECT TO THE      *
  15.   *   ACCURACY, RELIABILITY, PERFORMANCE, CURRENTNESS, OR OPERATION      *
  16.   *   OF THIS SOFTWARE, AND ALL USE IS AT YOUR OWN RISK.                 *
  17.   *   NEITHER COMMODORE NOR THE AUTHORS ASSUME ANY RESPONSIBILITY OR     *
  18.   *   LIABILITY WHATSOEVER WITH RESPECT TO YOUR USE OF THIS SOFTWARE.    *
  19.   *                                                                      *
  20.   *                          Non-Disclosure                              *
  21.   *                                                                      *
  22.   *   This information is not to be disclosed to any other company,      *
  23.   *   individual or party.  Discussion is to be restricted to CBM        *
  24.   *   approved discussion areas, such as the closed conferences on bix;  *
  25.   *   amiga.cert, amiga.com, amiga.beta/appshell.                        *
  26.   *                                                                      *
  27.   ************************************************************************
  28.   */
  29.  
  30. /* multiproj.h
  31.  * Header file for the multi-project skeleton
  32.  * Written by David N. Junod
  33.  *
  34.  */
  35.  
  36. #include <exec/types.h>
  37. #include <exec/memory.h>
  38. #include <exec/lists.h>
  39. #include <exec/ports.h>
  40. #include <exec/libraries.h>
  41. #include <intuition/intuition.h>
  42. #include <graphics/gfx.h>
  43. #include <dos/dos.h>
  44. #include <dos/dosextens.h>
  45. #include <libraries/asl.h>
  46. #include <libraries/gadtools.h>
  47. #include <libraries/appshell.h>
  48. #include <utility/tagitem.h>
  49. #include <workbench/workbench.h>
  50. #include <clib/macros.h>
  51. #include <clib/exec_protos.h>
  52. #include <clib/alib_protos.h>
  53. #include <clib/asl_protos.h>
  54. #include <clib/dos_protos.h>
  55. #include <clib/intuition_protos.h>
  56. #include <clib/graphics_protos.h>
  57. #include <clib/gadtools_protos.h>
  58. #include <clib/appshell_protos.h>
  59. #include <clib/appobjects_protos.h>
  60. #include <clib/utility_protos.h>
  61. #include <pragmas/asl.h>
  62. #include <pragmas/dos.h>
  63. #include <pragmas/exec.h>
  64. #include <pragmas/intuition.h>
  65. #include <pragmas/graphics.h>
  66. #include <pragmas/gadtools.h>
  67. #include <pragmas/appshell.h>
  68. #include <pragmas/appobjects.h>
  69. #include <pragmas/utility.h>
  70. #include <string.h>
  71. #include <stdio.h>
  72.  
  73. #include "ae:support/misc_protos.h"
  74.  
  75. /* The AppShell maintains some basic information on the application.  This
  76.  * information would appear in the About requester, and in AppExchange. */
  77. #define    APPNAME "MultiProj"
  78. #define    PROJNAME "MultiProj_Project"
  79. #define    APPVERS    "MultiProj 36.1 (2-Feb-91)"
  80. #define    APPCOPY "Copyright (C) 1991 Commodore-Amiga, Inc."
  81. #define    APPAUTH "David N. Junod"
  82.  
  83. /* File requester ID's. */
  84. #define    FR_PROJ    0
  85. #define    FR_MAX    1
  86.  
  87. /* This structure contains all the data that our application will need.
  88.  * Change to suit your application. */
  89. struct AppData
  90. {
  91.     struct FileRequester *ad_FR[FR_MAX];    /* File requesters */
  92.  
  93.     UBYTE ad_Name[512];        /* Temporary project name */
  94.     UBYTE ad_Tmp[512];        /* Temporary work buffer */
  95.     struct TagItem ad_TL[5];    /* Temporary tag array */
  96.  
  97.     struct AppInfo *ad_MAI;    /* Master AppInfo */
  98.     struct ProjNode *ad_PN;    /* Our project node */
  99.  
  100.     /* File requester positioning */
  101.     WORD ad_LeftEdge;
  102.     WORD ad_TopEdge;
  103.     WORD ad_Width;
  104.     WORD ad_Height;
  105. };
  106.  
  107. /* This structure contains all the data that our application will need.
  108.  * Change to suit your application. */
  109. struct MasterData
  110. {
  111.     UBYTE md_Tmp[512];        /* Temporary work buffer */
  112.     ULONG md_Flags;        /* Control Flags */
  113.     struct MsgPort *md_SIPC;    /* Our master SIPC port */
  114. };
  115.  
  116. /* Indicate that we're supposed to stick around when there are no projects. */
  117. #define    MADF_BACKG    0x00000001
  118.  
  119. /* Attach this to each project node */
  120. struct ProjData
  121. {
  122.     struct TagItem *pd_Clone;    /* Temporary clone of tags */
  123.     struct AppInfo *pd_AI;    /* AppInfo structure */
  124.     STRPTR pd_Port;        /* Pointer to the name of the SIPC port */
  125. };
  126.  
  127. /* Each public function gets a numeric ID assigned to it.  You must
  128.  * assign an ID to each one of your functions.  Look at appshell.h for
  129.  * standard function ID's for things like New, Open, Cut, Copy, Paste,
  130.  * Quit, etc... */
  131. #define DUMMYID        APSH_USER_ID
  132. #define CInitID        (DUMMYID +  1L)
  133. #define    CExitID        (DUMMYID +  2L)
  134. #define    IsActiveID    (DUMMYID +  3L)
  135. #define    SetAttrsID    (DUMMYID +  4L)
  136.  
  137. /* These are the function ID's for our project process */
  138. #define    PInitID        (DUMMYID + 10L)
  139. #define    PExitID        (DUMMYID + 11L)
  140. #define    OpenMainID    (DUMMYID + 12L)
  141. #define    OpenAboutID    (DUMMYID + 13L)
  142. #define    ChangeID    (DUMMYID + 14L)
  143. #define LAST_ID        (DUMMYID + 15L)
  144.  
  145.  
  146. /* These are the function prototypes for all the application implemented
  147.  * functions used in this example.  You must prototype all the functions
  148.  * that your application is going use in the function table. */
  149. VOID CInitFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  150. VOID NewFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  151. VOID OpenFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  152. VOID CloseFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  153. VOID QuitFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  154. VOID IsActiveFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  155. VOID ActiveToolFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  156. VOID SetAttrsFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  157. VOID CExitFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  158.  
  159. /* These are project related functions */
  160. VOID PInitFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  161. VOID PExitFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  162. VOID PNewFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  163. VOID PClearFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  164. VOID POpenFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  165. VOID PSaveFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  166. VOID PSaveAsFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  167. VOID PCloseFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  168. VOID PAboutFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  169. VOID PQuitFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  170. VOID OpenMainFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  171. VOID OpenAboutFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  172. VOID DropIconFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  173. VOID ChangeFunc (struct Hook *h, struct AppInfo *ai, struct AppFunction *af);
  174.  
  175. BOOL HandlerFunc (struct AppInfo * ai, ULONG tags,...);
  176.  
  177. void kprintf (void *, ...);
  178.  
  179. /* Shared system libraries */
  180. extern struct Library *SysBase;
  181. extern struct Library *DOSBase;
  182. extern struct Library *AslBase;
  183. extern struct Library *GadToolsBase;
  184. extern struct Library *GfxBase;
  185. extern struct Library *IconBase;
  186. extern struct Library *IntuitionBase;
  187. extern struct Library *UtilityBase;
  188. extern struct Library *AppShellBase;
  189. extern struct Library *AppObjectsBase;
  190. extern struct Library *MySpecialBase;
  191.